#ifndef HEXACONTROL_H
#define HEXACONTROL_H

#include <QtGui>
#include <QtCore>
//#include "../GeneratedFiles/ui_hexacontrol.h"

#include "glwidget.h"
#include "../../GeneratedFiles/ui_hexacontrol.h"
#include "Serial.h"

using namespace std;


class HexaControl : public  QMainWindow,  public Ui_HexaControlClass
{
  Q_OBJECT

public:
 

  QTimer *timerGL;
  QTimer *timerCOM;
  GLWidget *glOpenGL;
  Serial *cComPort;
  QPushButton *pbOpenComPort;
  QPushButton *pbCloseComPort;
  bool bCheckCom;
  bool bValidPort;

  HexaControl(QWidget *parent = 0, Qt::WFlags flags = 0);
  ~HexaControl();


  void addSetup(QMainWindow *HexaControlClass);

  void setup(QMainWindow *HexaControlClass){
    setupUi(HexaControlClass);
    addSetup(HexaControlClass);  
  };


  public slots:
    void updateGL();
     void openPort();
    void closePort();
    void readPort();

signals:
    void update();


private:

   sVector vGyro,
    vAcc,
    vMag;
};

#endif // HEXACONTROL_H
